#pragma once

#include <type_traits>

namespace sirtet
{

template <typename Num>
struct Vector2
{
    static_assert(std::is_arithmetic_v<Num>);
    Num x, y;
    Vector2()
    {
    }
    Vector2(Num x, Num y)
    {
        this->x = x;
        this->y = y;
    }

    Num dot(const Vector2 &lhs)
    {
        return x * lhs.x + y * lhs.y;
    }
};

template <typename Num>
Vector2<Num> operator+(const Vector2<Num> &rhs, const Vector2<Num> &lhs)
{
    return Vector2<Num>{.x = rhs.x + lhs.x, .y = rhs.y + lhs.y};
}

} // namespace Sirtet